﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:CBR.Components.Controls"
					xmlns:Designer="clr-namespace:CBR.Components.Designer"
                    xmlns:Converters="clr-namespace:CBR.Components.Converters"
                    >

    <!-- PageControl-->
    <Style x:Key="{x:Type local:PageControl}" TargetType="{x:Type local:PageControl}">
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:PageControl}">
					<ScrollViewer Style="{DynamicResource CbrScrollViewer}" Name="PART_ScrollViewer" Focusable="True" 
								  VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
                        <Grid>
                        <Image Name="PART_Image" Focusable="True" IsHitTestVisible="True" 
                               VerticalAlignment="Center" HorizontalAlignment="Center"
                               Source="{TemplateBinding ImageSource}" />
							<Designer:DrawingLayer ItemsSource="{TemplateBinding FrameList}"
									x:Name="PART_DrawingLayer"
                                    HorizontalAlignment="Center" VerticalAlignment="Center"
                                    Width="{Binding Path=ActualWidth, ElementName=PART_Image, Mode=OneWay}"
                                    Height="{Binding Path=ActualHeight, ElementName=PART_Image, Mode=OneWay}"
                                    LayoutTransform="{Binding LayoutTransform, ElementName=PART_Image, Mode=OneWay }"
                                    Visibility="{Binding IsInEditMode, Converter={x:Static Converters:BoolToVisibilityConverter.Instance}}"
                                    Background="#94808080"/>
                        </Grid>
                    </ScrollViewer>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>